package studyOwn;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Scanner;

public class ChatDemo {
    /*
    //http://api.qingyunke.com/api.php?key=free&appid=0&msg= 说的话
     */

    public static void main(String[] args) throws IOException {

        // url 定位
        Scanner sc = new Scanner(System.in);
        String worlds = sc.nextLine();
        URL url = new URL("http://api.qingyunke.com/api.php?key=free&appid=0&msg=" + worlds);

        //获取反馈的数据
        InputStream inputStream = url.openStream();

        //缓冲流BufferedReader
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        String result = bufferedReader.readLine();

        // JSON 数据的读取emm
        String[] split = result.split("\"");
        System.out.println(split[5]);
    }
}
